<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动</title>
    <style>
        .parent{
            border: 1px solid #7d75ee;
            background-color: hotpink;
        }
        .box1{
            width: 200px;
            height: 200px;
            background-color: red;
            float: left;
        }   
        .box2{
            width: 200px;
            height: 250px;
            background-color: green;
            
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="box1"></div>
        <div class="box2"></div>

    </div>
    
</body>
</html>